//package com.redis.demo.listener;
//
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.boot.ApplicationArguments;
//import org.springframework.boot.ApplicationRunner;
//import org.springframework.data.redis.core.RedisTemplate;
//import org.springframework.stereotype.Component;
//
//import javax.ws.rs.core.Application;
//import java.util.concurrent.TimeUnit;
//
///**
// * @Author zqf
// * @Date 2022/10/28 14:33
// * @Description: 项目启动时只执行一次
// */
//@Component
//public class MyRanner implements ApplicationRunner {
//
//    @Autowired
//    private RedisTemplate<String, Object> redisTemplate;
//
//    @Override
//    public void run(ApplicationArguments args) throws Exception {
//
//        while (true){
//            Object queue = redisTemplate.opsForList().rightPop("queue", 200000, TimeUnit.MILLISECONDS);
//            System.out.println("开始处理redis的消息队列消息 = " + queue);
//        }
//    }
//}
